import Mock from 'mockjs'
const Random = Mock.Random
// 用户数据
const userList = () => {
    let data = []
    for (let i = 0; i < 10; i++) {
        data.push({
            id: i + 1,
            date: Random.date('yyyy-MM-dd'),
            name: Random.cname(),
            address: Mock.mock('@county(true)'),
            phone: Mock.mock(/^1[0-9]{10}$/),
            status: Random.integer(0, 1),
            disabled: Random.boolean(),
            title: Random.title()
        })
    }
    return {
        success: true,
        data,
        errorHint: null
    }
}
// 项目进度
const projectList = () => {
    let data = []
    for (let i = 0; i < 10; i++) {
        data.push({
            experimentId: i + 1,
            completeTime: Random.date('y-MM-dd HH:mm:ss'),
            jobStatus: Mock.mock(/^[0-5]$/) - 0,
            tableName: Random.title()
        })
    }
    return {
        success: true,
        data: {
            rows: data,
            total: data.length
        },
        errorHint: null
    }
}
Mock.mock('/users', userList)
Mock.mock('/project/progress', projectList)
